package com.wf.ew.common;

public class DataUtil {

    public static Data success(String msg) {
        return new Data(200, msg);
    }

    public static Data success(String msg, Object obj) {
        return new Data(200, msg, obj);
    }

    public static Data error(String msg) {
        return new Data(-1, msg);
    }

    static class Data {

        private int code;
        private String msg;
        private Object data;

        public Data() {

        }

        public Data(int code, String msg) {
            this.code = code;
            this.msg = msg;
        }


        public Data(int code, String msg, Object o) {
            this.code = code;
            this.msg = msg;
            this.data = o;
        }


        public int getCode() {
            return code;
        }

        public void setCode(int code) {
            this.code = code;
        }

        public String getMsg() {
            return msg;
        }

        public void setMsg(String msg) {
            this.msg = msg;
        }

        public Object getData() {
            return data;
        }

        public void setData(Object data) {
            this.data = data;
        }
    }


}
